function validate(reg) {
  return function(value) {
    return reg.test(value);
  };
}

const isPhone = validate(/^1(3|4|5|6|7|8|9)\d{9}$/);
const isEmail = validate(/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/);

export { isPhone, isEmail };
